package com.norbitltd.guavaleaves.java.util;

import java.util.Map;

import com.google.common.base.Predicate;

public class MapPredicates {
	public static Predicate<Map<?,?>> containsValue( final Object value ) {
		return new Predicate<Map<?,?>>() {
			public boolean apply(Map<?,?> input) {
				return input.containsValue(value);
			}
		};
	}

	public static Predicate<Map<?,?>> containsKey( final Object key ) {
		return new Predicate<Map<?,?>>() {
			public boolean apply(Map<?,?> input) {
				return input.containsKey(key);
			}
		};
	}

	public static Predicate<Map<?,?>> isEmpty() {
		return new Predicate<Map<?,?>>() {
			public boolean apply(Map<?,?> input) {
				return input.isEmpty();
			}
		};
	}
}
